

//
//  PicDetailView.m
//  1243
//
//  Created by apple on 16/6/30.
//  Copyright © 2016年 1243. All rights reserved.
//

#import "PicDetailView.h"
#import "PicDetailTableViewCell.h"
@interface PicDetailView ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation PicDetailView
{
    UITableView             *detailTBV;
}
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        UILabel *title = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 50)];
        title.backgroundColor = [UIColor whiteColor];
        title.text = @"图文详情";
        title.textAlignment = NSTextAlignmentCenter;
        
        detailTBV = [[UITableView alloc]initWithFrame:CGRectMake(0, 50, WIDTH, frame.size.height - 50)];
        detailTBV.delegate = self;
        detailTBV.dataSource =self;
        detailTBV.showsVerticalScrollIndicator = NO;
        [detailTBV registerClass:[PicDetailTableViewCell class] forCellReuseIdentifier:@"OVERCELL"];
        [self addSubview:title];
        [self addSubview:detailTBV];
    }
    return self;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
        return 210;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 50;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 0.01;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        PicDetailTableViewCell *cell = [detailTBV dequeueReusableCellWithIdentifier:@"OVERCELL" forIndexPath:indexPath];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    [cell.picIV setImage:[UIImage imageNamed:@"hahahouhou"]];
    return cell;
}






@end
